<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>作业</title>
    <style>
        /* 字体声明 */
        @font-face {
            font-family: 'icomoon';
            src: url('fonts/icomoon.eot?t9tqv');
            src: url('fonts/icomoon.eot?t9tqv#iefix') format('embedded-opentype'),
                url('fonts/icomoon.ttf?t9tqv') format('truetype'),
                url('fonts/icomoon.woff?t9tqv') format('woff'),
                url('fonts/icomoon.svg?t9tqv#icomoon') format('svg');
            font-weight: normal;
            font-style: normal;
            font-display: block;
        }

        .box1 {
            position: absolute;
            width: 80px;
            height: 40px;
            background-color: pink;
        }

        span {
            /* position: absolute; */
            top: 0;
            left: 0;
            font-family: 'icomoon';
            font-size: 36px;
        }

        .box2 {
            width: 40px;
            height: 40px;
            background-color: red;
        }

        .box2:hover .box1 {
            position: absolute;
            left: -40px;
        }
    </style>
</head>

<body>
    <div class="box1">
        <span></span>
        <span></span>
    </div>
    <div class="box2"></div>
</body>

</html>